﻿@using BlazorCommunity.Admin.ViewModel
@inherits AdminCreatePageBase

<div class="login-container">
    <BForm @ref="form" EnableAlwaysRender="true">
        <div class="title-container">
            <h3 class="title">
                @(IsAdmin ? "注册普通用户":"创建管理员")
            </h3>
        </div>
        <BFormItem IsRequired="true" TValue="string" RequiredMessage="请输入账号" Name="@nameof(AdminLoginInfoModel.Username)">
            <BInput PrefixIcon="el-icon-user-solid" TValue="string" Placeholder="账号"></BInput>
        </BFormItem>
        <BFormItem IsRequired="true" TValue="string" RequiredMessage="请输入密码" Name="@nameof(AdminLoginInfoModel.Password)" EnableAlwaysRender="true">
            <BInput PrefixIcon="el-icon-lock" SuffixIcon="el-icon-view" OnSuffixIconClick="e=>TogglePassword()" Type="@passwordType" TValue="string" Placeholder="密码" EnableClearButton="true"></BInput>
        </BFormItem>

        <BFormActionItem>
            <BButton Type="@ButtonType.Primary" OnClick="CreateAsync" Style="width:100%;">@(IsAdmin ? "注册" : "创建")</BButton>
        </BFormActionItem>
    </BForm>
</div>